; E:\PORNPOJ\Y2005\INC361\EX2010\CONTEST1.C - Compiled by CC68K  Version 5.00 (c) 1991-2005  Peter J.Fondse
; #include <stdio.h>
; //#include "test.h"
; #define N 6
; int i, j, k, l;
; #if 0
; char reverse[100];
; char upper[100];
; char lower[100];
; char numer[100];
; #endif
; void main(void)
; {
       section   code
       xdef      _main
_main:
       movem.l   A2/A3,-(A7)
       lea       _i,A2
       lea       _j,A3
; #if 0
; printf("original = %s\n\r", test);
; for( i=0; test[i] != 0; i++ );
; for( j=0; i > 0; i--, j++ )
; {
; reverse[j] = test[i-1];
; }
; reverse[j] = 0;
; printf("reverse  = %s\n\r", reverse);
; for( i=0, j=0, k=0, l=0; test[i] != 0; i++ )
; {
; if(( reverse[i] >= 'A' ) && ( reverse[i] <= 'Z' ))
; {
; upper[j] = reverse[i];
; j++;
; }
; else if(( reverse[i] >= 'a' ) && ( reverse[i] <= 'z' ))
; {
; lower[k] = reverse[i];
; k++;
; }
; else if(( reverse[i] >= '0' ) && ( reverse[i] <= '9' ))
; {
; numer[l] = reverse[i];
; l++;
; }
; }
; upper[j] = 0;
; lower[k] = 0;
; numer[l] = 0;
; printf("upper = %s\n\r", upper);
; printf("lower = %s\n\r", lower);
; printf("numer = %s\n\r", numer);
; #endif
; j = 0;
       clr.l     (A3)
; for( i=1;i<N;i++ )
       move.l    #1,(A2)
main_1:
       move.l    (A2),D0
       cmp.l     #6,D0
       bge.s     main_3
; {
; j = j + i;
       move.l    (A2),D0
       add.l     D0,(A3)
main_2:
       addq.l    #1,(A2)
       bra       main_1
main_3:
; }
; printf("%d", j);
       move.l    (A3),-(A7)
       pea       @contest1_1
       bsr       _printf
       addq.w    #8,A7
       movem.l   (A7)+,A2/A3
       rts
; }
       section   data
@contest1_1:
       dc.b      37,100,0
       section   bss
       xdef      _i
_i:
       ds.b      4
       xdef      _j
_j:
       ds.b      4
       xdef      _k
_k:
       ds.b      4
       xdef      _l
_l:
       ds.b      4
       xref      _printf
